'''
Created on 2011-1-8

@author: zarra
'''
import cherrypy,os,sys,time

PROJECT_PATH     = os.path.abspath(os.path.dirname(__file__))
PROJECT_Parent_PATH=os.path.split(PROJECT_PATH)[0]
print PROJECT_Parent_PATH
sys.path.append( os.path.join(PROJECT_Parent_PATH,'zapple'))

import conf
from root import Root

stat = os.stat(__file__)
mtime =  time.localtime(stat.st_mtime)

conf.cmtime = "%d%02d%02d_%d%d%d"%(mtime.tm_year,\
                           mtime.tm_mon,\
                           mtime.tm_mday,\
                           mtime.tm_hour,\
                           mtime.tm_min,\
                           mtime.tm_sec)

if __name__ == '__main__':
    conf.SITE_ROOT = '/'
    cherrypy.config.update(conf.alone_global_conf)
    
    root=Root()
    cherrypy.tree.mount(root,conf.SITE_ROOT,config=conf.application_conf)
    
    cherrypy.engine.start()
